<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>class Bundler::Definition - bundler: Ruby Standard Library Documentation</title>


<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>

<script src="../js/jquery-3.2.0.min.js"></script>

<script src="../js/vue.min.js"></script>
<script src="../js/js.cookie.min.js"></script>

<link href="../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../css/rdoc.css" rel="stylesheet">
<link href="../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../";
  var index_rel_prefix = "../";
  var darkModeCsseHref = "../css/rdoc-dm.css"
  var defaultModeCssHref = "../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="class">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link"><a href="../Object.html">Object</a>
</div>

        
<div id="includes-section" class="nav-section">
  <h3>Included Modules</h3>

  <ul class="link-list">
    <li><a class="include" href="GemHelpers.html">Bundler::GemHelpers</a>
  </ul>
</div>

        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-c-build">::build</a>
    <li ><a href="#method-c-new">::new</a>
    <li ><a href="#method-i-add_current_platform">#add_current_platform</a>
    <li ><a href="#method-i-add_platform">#add_platform</a>
    <li ><a href="#method-i-additional_base_requirements_for_resolve">#additional_base_requirements_for_resolve</a>
    <li ><a href="#method-i-bundler_version_to_lock">#bundler_version_to_lock</a>
    <li ><a href="#method-i-change_reason">#change_reason</a>
    <li ><a href="#method-i-check_missing_lockfile_dep">#check_missing_lockfile_dep</a>
    <li ><a href="#method-i-converge_dependencies">#converge_dependencies</a>
    <li ><a href="#method-i-converge_locals">#converge_locals</a>
    <li ><a href="#method-i-converge_locked_specs">#converge_locked_specs</a>
    <li ><a href="#method-i-converge_path_source_to_gemspec_source">#converge_path_source_to_gemspec_source</a>
    <li ><a href="#method-i-converge_path_sources_to_gemspec_sources">#converge_path_sources_to_gemspec_sources</a>
    <li ><a href="#method-i-converge_paths">#converge_paths</a>
    <li ><a href="#method-i-converge_sources">#converge_sources</a>
    <li ><a href="#method-i-converge_specs">#converge_specs</a>
    <li ><a href="#method-i-current_dependencies">#current_dependencies</a>
    <li ><a href="#method-i-current_locked_dependencies">#current_locked_dependencies</a>
    <li ><a href="#method-i-current_platform_locked-3F">#current_platform_locked?</a>
    <li ><a href="#method-i-current_ruby_platform_locked-3F">#current_ruby_platform_locked?</a>
    <li ><a href="#method-i-default_source">#default_source</a>
    <li ><a href="#method-i-deleted_deps">#deleted_deps</a>
    <li ><a href="#method-i-dependencies_for">#dependencies_for</a>
    <li ><a href="#method-i-dependencies_for_source_changed-3F">#dependencies_for_source_changed?</a>
    <li ><a href="#method-i-dependencies_with_bundler">#dependencies_with_bundler</a>
    <li ><a href="#method-i-ensure_equivalent_gemfile_and_lockfile">#ensure_equivalent_gemfile_and_lockfile</a>
    <li ><a href="#method-i-expanded_dependencies">#expanded_dependencies</a>
    <li ><a href="#method-i-filter_relevant">#filter_relevant</a>
    <li ><a href="#method-i-filter_specs">#filter_specs</a>
    <li ><a href="#method-i-gem_version_promoter">#gem_version_promoter</a>
    <li ><a href="#method-i-groups">#groups</a>
    <li ><a href="#method-i-lock">#lock</a>
    <li ><a href="#method-i-locked_dependencies">#locked_dependencies</a>
    <li ><a href="#method-i-locked_ruby_version">#locked_ruby_version</a>
    <li ><a href="#method-i-locked_ruby_version_object">#locked_ruby_version_object</a>
    <li ><a href="#method-i-lockfiles_equal-3F">#lockfiles_equal?</a>
    <li ><a href="#method-i-materialize">#materialize</a>
    <li ><a href="#method-i-metadata_dependencies">#metadata_dependencies</a>
    <li ><a href="#method-i-missing_specs">#missing_specs</a>
    <li ><a href="#method-i-missing_specs-3F">#missing_specs?</a>
    <li ><a href="#method-i-most_specific_locked_platform">#most_specific_locked_platform</a>
    <li ><a href="#method-i-new_deps">#new_deps</a>
    <li ><a href="#method-i-new_specs">#new_specs</a>
    <li ><a href="#method-i-no_resolve_needed-3F">#no_resolve_needed?</a>
    <li ><a href="#method-i-nothing_changed-3F">#nothing_changed?</a>
    <li ><a href="#method-i-pin_locally_available_names">#pin_locally_available_names</a>
    <li ><a href="#method-i-precompute_source_requirements_for_indirect_dependencies-3F">#precompute_source_requirements_for_indirect_dependencies?</a>
    <li ><a href="#method-i-pretty_dep">#pretty_dep</a>
    <li ><a href="#method-i-remove_platform">#remove_platform</a>
    <li ><a href="#method-i-remove_ruby_from_platforms_if_necessary-21">#remove_ruby_from_platforms_if_necessary!</a>
    <li ><a href="#method-i-removed_specs">#removed_specs</a>
    <li ><a href="#method-i-requested_dependencies">#requested_dependencies</a>
    <li ><a href="#method-i-requested_groups">#requested_groups</a>
    <li ><a href="#method-i-requested_specs">#requested_specs</a>
    <li ><a href="#method-i-resolution_mode-3D">#resolution_mode=</a>
    <li ><a href="#method-i-resolution_packages">#resolution_packages</a>
    <li ><a href="#method-i-resolve">#resolve</a>
    <li ><a href="#method-i-resolve_only_locally-21">#resolve_only_locally!</a>
    <li ><a href="#method-i-resolve_remotely-21">#resolve_remotely!</a>
    <li ><a href="#method-i-resolve_with_cache-21">#resolve_with_cache!</a>
    <li ><a href="#method-i-resolver">#resolver</a>
    <li ><a href="#method-i-setup_sources_for_resolve">#setup_sources_for_resolve</a>
    <li ><a href="#method-i-source_map">#source_map</a>
    <li ><a href="#method-i-source_requirements">#source_requirements</a>
    <li ><a href="#method-i-spec_git_paths">#spec_git_paths</a>
    <li ><a href="#method-i-specs">#specs</a>
    <li ><a href="#method-i-specs_changed-3F">#specs_changed?</a>
    <li ><a href="#method-i-specs_for">#specs_for</a>
    <li ><a href="#method-i-specs_for_source_changed-3F">#specs_for_source_changed?</a>
    <li ><a href="#method-i-start_resolution">#start_resolution</a>
    <li ><a href="#method-i-to_lock">#to_lock</a>
    <li ><a href="#method-i-unlocking-3F">#unlocking?</a>
    <li ><a href="#method-i-validate_platforms-21">#validate_platforms!</a>
    <li ><a href="#method-i-validate_ruby-21">#validate_ruby!</a>
    <li ><a href="#method-i-validate_runtime-21">#validate_runtime!</a>
    <li ><a href="#method-i-verify_changed_sources-21">#verify_changed_sources!</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="class-Bundler::Definition">
    <h1 id="class-Bundler::Definition" class="class">
      class Bundler::Definition
    </h1>

    <section class="description">
    
    </section>

      <section id="5Buntitled-5D" class="documentation-section">



        <section class="attribute-method-details" class="method-section">
        <header>
        <h3>Attributes</h3>
        </header>

          <div id="attribute-c-no_lock" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">no_lock</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>Do not create or modify a lockfile (Makes <a href="Definition.html#method-i-lock"><code>lock</code></a> a noop)</p>
              </div>
            </div>
          <div id="attribute-i-dependencies" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">dependencies</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-gemfiles" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">gemfiles</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-locked_deps" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">locked_deps</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-locked_gems" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">locked_gems</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-lockfile" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">lockfile</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-platforms" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">platforms</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-ruby_version" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">ruby_version</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-sources" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">sources</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
            </section>


                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-build" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">build</span><span
                                class="method-args">(gemfile, lockfile, unlock)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Given a gemfile and lockfile creates a <a href="../Bundler.html"><code>Bundler</code></a> definition</p>

<p>@param gemfile [Pathname] Path to Gemfile @param lockfile [Pathname,nil] Path to Gemfile.lock @param unlock [Hash, Boolean, nil] Gems that have been requested</p>

<pre class="ruby"><span class="ruby-identifier">to</span> <span class="ruby-identifier">be</span> <span class="ruby-identifier">updated</span> <span class="ruby-keyword">or</span> <span class="ruby-keyword">true</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">all</span> <span class="ruby-identifier">gems</span> <span class="ruby-identifier">should</span> <span class="ruby-identifier">be</span> <span class="ruby-identifier">updated</span>
</pre>

<p>@return [Bundler::Definition]</p>

                              <div class="method-source-code" id="build-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 31</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">build</span>(<span class="ruby-identifier">gemfile</span>, <span class="ruby-identifier">lockfile</span>, <span class="ruby-identifier">unlock</span>)
  <span class="ruby-identifier">unlock</span> <span class="ruby-operator">||=</span> {}
  <span class="ruby-identifier">gemfile</span> = <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">gemfile</span>).<span class="ruby-identifier">expand_path</span>

  <span class="ruby-identifier">raise</span> <span class="ruby-constant">GemfileNotFound</span>, <span class="ruby-node">&quot;#{gemfile} not found&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">gemfile</span>.<span class="ruby-identifier">file?</span>

  <span class="ruby-constant">Dsl</span>.<span class="ruby-identifier">evaluate</span>(<span class="ruby-identifier">gemfile</span>, <span class="ruby-identifier">lockfile</span>, <span class="ruby-identifier">unlock</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-new" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">new</span><span
                                class="method-args">(lockfile, dependencies, sources, unlock, ruby_version = nil, optional_groups = [], gemfiles = [])</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>How does the new system work?</p>
<ul><li>
<p>Load information from Gemfile and Lockfile</p>
</li><li>
<p>Invalidate stale locked specs</p>
</li><li>
<p>All specs from stale source are stale</p>
</li><li>
<p>All specs that are reachable only through a stale dependency are stale.</p>
</li><li>
<p>If all fresh dependencies are satisfied by the locked</p>
</li></ul>

<pre>specs, then we can try to resolve locally.</pre>

<p>@param lockfile [Pathname] Path to Gemfile.lock @param dependencies [Array(<a href="Dependency.html"><code>Bundler::Dependency</code></a>)] array of dependencies from Gemfile @param sources [Bundler::SourceList] @param unlock [Hash, Boolean, nil] Gems that have been requested</p>

<pre class="ruby"><span class="ruby-identifier">to</span> <span class="ruby-identifier">be</span> <span class="ruby-identifier">updated</span> <span class="ruby-keyword">or</span> <span class="ruby-keyword">true</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">all</span> <span class="ruby-identifier">gems</span> <span class="ruby-identifier">should</span> <span class="ruby-identifier">be</span> <span class="ruby-identifier">updated</span>
</pre>

<p>@param <a href="Definition.html#attribute-i-ruby_version"><code>ruby_version</code></a> [Bundler::RubyVersion, nil] Requested Ruby Version @param optional_groups [Array(String)] A list of optional groups</p>

                              <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 58</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">lockfile</span>, <span class="ruby-identifier">dependencies</span>, <span class="ruby-identifier">sources</span>, <span class="ruby-identifier">unlock</span>, <span class="ruby-identifier">ruby_version</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">optional_groups</span> = [], <span class="ruby-identifier">gemfiles</span> = [])
  <span class="ruby-keyword">if</span> [<span class="ruby-keyword">true</span>, <span class="ruby-keyword">false</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">unlock</span>)
    <span class="ruby-ivar">@unlocking_bundler</span> = <span class="ruby-keyword">false</span>
    <span class="ruby-ivar">@unlocking</span> = <span class="ruby-identifier">unlock</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@unlocking_bundler</span> = <span class="ruby-identifier">unlock</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:bundler</span>)
    <span class="ruby-ivar">@unlocking</span> = <span class="ruby-identifier">unlock</span>.<span class="ruby-identifier">any?</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">_k</span>, <span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-operator">!</span><span class="ruby-constant">Array</span>(<span class="ruby-identifier">v</span>).<span class="ruby-identifier">empty?</span> }
  <span class="ruby-keyword">end</span>

  <span class="ruby-ivar">@dependencies</span>    = <span class="ruby-identifier">dependencies</span>
  <span class="ruby-ivar">@sources</span>         = <span class="ruby-identifier">sources</span>
  <span class="ruby-ivar">@unlock</span>          = <span class="ruby-identifier">unlock</span>
  <span class="ruby-ivar">@optional_groups</span> = <span class="ruby-identifier">optional_groups</span>
  <span class="ruby-ivar">@remote</span>          = <span class="ruby-keyword">false</span>
  <span class="ruby-ivar">@prefer_local</span>    = <span class="ruby-keyword">false</span>
  <span class="ruby-ivar">@specs</span>           = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@ruby_version</span>    = <span class="ruby-identifier">ruby_version</span>
  <span class="ruby-ivar">@gemfiles</span>        = <span class="ruby-identifier">gemfiles</span>

  <span class="ruby-ivar">@lockfile</span>               = <span class="ruby-identifier">lockfile</span>
  <span class="ruby-ivar">@lockfile_contents</span>      = <span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>

  <span class="ruby-ivar">@locked_bundler_version</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@resolved_bundler_version</span> = <span class="ruby-keyword">nil</span>

  <span class="ruby-ivar">@locked_ruby_version</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@new_platform</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@removed_platform</span> = <span class="ruby-keyword">nil</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">lockfile</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">lockfile</span>)
    <span class="ruby-ivar">@lockfile_contents</span> = <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">read_file</span>(<span class="ruby-identifier">lockfile</span>)
    <span class="ruby-ivar">@locked_gems</span> = <span class="ruby-constant">LockfileParser</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@lockfile_contents</span>)
    <span class="ruby-ivar">@locked_platforms</span> = <span class="ruby-ivar">@locked_gems</span>.<span class="ruby-identifier">platforms</span>
    <span class="ruby-ivar">@platforms</span> = <span class="ruby-ivar">@locked_platforms</span>.<span class="ruby-identifier">dup</span>
    <span class="ruby-ivar">@locked_bundler_version</span> = <span class="ruby-ivar">@locked_gems</span>.<span class="ruby-identifier">bundler_version</span>
    <span class="ruby-ivar">@locked_ruby_version</span> = <span class="ruby-ivar">@locked_gems</span>.<span class="ruby-identifier">ruby_version</span>
    <span class="ruby-ivar">@originally_locked_specs</span> = <span class="ruby-constant">SpecSet</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@locked_gems</span>.<span class="ruby-identifier">specs</span>)

    <span class="ruby-keyword">if</span> <span class="ruby-identifier">unlock</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword">true</span>
      <span class="ruby-ivar">@locked_deps</span>    = <span class="ruby-ivar">@locked_gems</span>.<span class="ruby-identifier">dependencies</span>
      <span class="ruby-ivar">@locked_specs</span>   = <span class="ruby-ivar">@originally_locked_specs</span>
      <span class="ruby-ivar">@locked_sources</span> = <span class="ruby-ivar">@locked_gems</span>.<span class="ruby-identifier">sources</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-ivar">@unlock</span>         = {}
      <span class="ruby-ivar">@locked_deps</span>    = {}
      <span class="ruby-ivar">@locked_specs</span>   = <span class="ruby-constant">SpecSet</span>.<span class="ruby-identifier">new</span>([])
      <span class="ruby-ivar">@locked_sources</span> = []
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@unlock</span>         = {}
    <span class="ruby-ivar">@platforms</span>      = []
    <span class="ruby-ivar">@locked_gems</span>    = <span class="ruby-keyword">nil</span>
    <span class="ruby-ivar">@locked_deps</span>    = {}
    <span class="ruby-ivar">@locked_specs</span>   = <span class="ruby-constant">SpecSet</span>.<span class="ruby-identifier">new</span>([])
    <span class="ruby-ivar">@originally_locked_specs</span> = <span class="ruby-ivar">@locked_specs</span>
    <span class="ruby-ivar">@locked_sources</span> = []
    <span class="ruby-ivar">@locked_platforms</span> = []
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">locked_gem_sources</span> = <span class="ruby-ivar">@locked_sources</span>.<span class="ruby-identifier">select</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Source</span><span class="ruby-operator">::</span><span class="ruby-constant">Rubygems</span>) }
  <span class="ruby-ivar">@multisource_allowed</span> = <span class="ruby-identifier">locked_gem_sources</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">locked_gem_sources</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">multiple_remotes?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">frozen_bundle?</span>

  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@multisource_allowed</span>
    <span class="ruby-keyword">unless</span> <span class="ruby-identifier">sources</span>.<span class="ruby-identifier">aggregate_global_source?</span>
      <span class="ruby-identifier">msg</span> = <span class="ruby-string">&quot;Your lockfile contains a single rubygems source section with multiple remotes, which is insecure. Make sure you run `bundle install` in non frozen mode and commit the result to make your lockfile secure.&quot;</span>

      <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">major_deprecation</span> <span class="ruby-value">2</span>, <span class="ruby-identifier">msg</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-ivar">@sources</span>.<span class="ruby-identifier">merged_gem_lockfile_sections!</span>(<span class="ruby-identifier">locked_gem_sources</span>.<span class="ruby-identifier">first</span>)
  <span class="ruby-keyword">end</span>

  <span class="ruby-ivar">@unlock</span>[<span class="ruby-value">:sources</span>] <span class="ruby-operator">||=</span> []
  <span class="ruby-ivar">@unlock</span>[<span class="ruby-value">:ruby</span>] <span class="ruby-operator">||=</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@ruby_version</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">locked_ruby_version_object</span>
    <span class="ruby-ivar">@ruby_version</span>.<span class="ruby-identifier">diff</span>(<span class="ruby-identifier">locked_ruby_version_object</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@unlocking</span> <span class="ruby-operator">||=</span> <span class="ruby-ivar">@unlock</span>[<span class="ruby-value">:ruby</span>] <span class="ruby-operator">||=</span> (<span class="ruby-operator">!</span><span class="ruby-ivar">@locked_ruby_version</span> <span class="ruby-operator">^</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@ruby_version</span>)

  <span class="ruby-identifier">add_current_platform</span> <span class="ruby-keyword">unless</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">frozen_bundle?</span>

  <span class="ruby-identifier">converge_path_sources_to_gemspec_sources</span>
  <span class="ruby-ivar">@path_changes</span> = <span class="ruby-identifier">converge_paths</span>
  <span class="ruby-ivar">@source_changes</span> = <span class="ruby-identifier">converge_sources</span>

  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@unlock</span>[<span class="ruby-value">:conservative</span>]
    <span class="ruby-ivar">@unlock</span>[<span class="ruby-value">:gems</span>] <span class="ruby-operator">||=</span> <span class="ruby-ivar">@dependencies</span>.<span class="ruby-identifier">map</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:name</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">eager_unlock</span> = (<span class="ruby-ivar">@unlock</span>[<span class="ruby-value">:gems</span>] <span class="ruby-operator">||</span> []).<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span> <span class="ruby-constant">Dependency</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">name</span>, <span class="ruby-string">&quot;&gt;= 0&quot;</span>) }
    <span class="ruby-ivar">@unlock</span>[<span class="ruby-value">:gems</span>] = <span class="ruby-ivar">@locked_specs</span>.<span class="ruby-identifier">for</span>(<span class="ruby-identifier">eager_unlock</span>, <span class="ruby-keyword">false</span>, <span class="ruby-identifier">platforms</span>).<span class="ruby-identifier">map</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:name</span>).<span class="ruby-identifier">uniq</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-ivar">@dependency_changes</span> = <span class="ruby-identifier">converge_dependencies</span>
  <span class="ruby-ivar">@local_changes</span> = <span class="ruby-identifier">converge_locals</span>

  <span class="ruby-ivar">@missing_lockfile_dep</span> = <span class="ruby-identifier">check_missing_lockfile_dep</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-add_platform" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">add_platform</span><span
                                class="method-args">(platform)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="add_platform-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 459</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">add_platform</span>(<span class="ruby-identifier">platform</span>)
  <span class="ruby-ivar">@new_platform</span> <span class="ruby-operator">||=</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@platforms</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">platform</span>)
  <span class="ruby-ivar">@platforms</span> <span class="ruby-operator">|=</span> [<span class="ruby-identifier">platform</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-bundler_version_to_lock" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">bundler_version_to_lock</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="bundler_version_to_lock-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 364</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">bundler_version_to_lock</span>
  <span class="ruby-ivar">@resolved_bundler_version</span> <span class="ruby-operator">||</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">gem_version</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-current_dependencies" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">current_dependencies</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="current_dependencies-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 239</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">current_dependencies</span>
  <span class="ruby-identifier">filter_relevant</span>(<span class="ruby-identifier">dependencies</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-current_locked_dependencies" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">current_locked_dependencies</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="current_locked_dependencies-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 243</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">current_locked_dependencies</span>
  <span class="ruby-identifier">filter_relevant</span>(<span class="ruby-identifier">locked_dependencies</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-deleted_deps" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">deleted_deps</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="deleted_deps-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 261</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">deleted_deps</span>
  <span class="ruby-ivar">@deleted_deps</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">locked_dependencies</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@dependencies</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-dependencies_for" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">dependencies_for</span><span
                                class="method-args">(groups)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="dependencies_for-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 271</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">dependencies_for</span>(<span class="ruby-identifier">groups</span>)
  <span class="ruby-identifier">groups</span>.<span class="ruby-identifier">map!</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:to_sym</span>)
  <span class="ruby-identifier">current_dependencies</span>.<span class="ruby-identifier">reject</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">d</span><span class="ruby-operator">|</span>
    (<span class="ruby-identifier">d</span>.<span class="ruby-identifier">groups</span> <span class="ruby-operator">&amp;</span> <span class="ruby-identifier">groups</span>).<span class="ruby-identifier">empty?</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-ensure_equivalent_gemfile_and_lockfile" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ensure_equivalent_gemfile_and_lockfile</span><span
                                class="method-args">(explicit_flag = false)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="ensure_equivalent_gemfile_and_lockfile-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 373</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ensure_equivalent_gemfile_and_lockfile</span>(<span class="ruby-identifier">explicit_flag</span> = <span class="ruby-keyword">false</span>)
  <span class="ruby-identifier">added</span> =   []
  <span class="ruby-identifier">deleted</span> = []
  <span class="ruby-identifier">changed</span> = []

  <span class="ruby-identifier">new_platforms</span> = <span class="ruby-ivar">@platforms</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@locked_platforms</span>
  <span class="ruby-identifier">deleted_platforms</span> = <span class="ruby-ivar">@locked_platforms</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@platforms</span>
  <span class="ruby-identifier">added</span>.<span class="ruby-identifier">concat</span> <span class="ruby-identifier">new_platforms</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span> <span class="ruby-node">&quot;* platform: #{p}&quot;</span> }
  <span class="ruby-identifier">deleted</span>.<span class="ruby-identifier">concat</span> <span class="ruby-identifier">deleted_platforms</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span> <span class="ruby-node">&quot;* platform: #{p}&quot;</span> }

  <span class="ruby-identifier">added</span>.<span class="ruby-identifier">concat</span> <span class="ruby-identifier">new_deps</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">d</span><span class="ruby-operator">|</span> <span class="ruby-node">&quot;* #{pretty_dep(d)}&quot;</span> } <span class="ruby-keyword">if</span> <span class="ruby-identifier">new_deps</span>.<span class="ruby-identifier">any?</span>
  <span class="ruby-identifier">deleted</span>.<span class="ruby-identifier">concat</span> <span class="ruby-identifier">deleted_deps</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">d</span><span class="ruby-operator">|</span> <span class="ruby-node">&quot;* #{pretty_dep(d)}&quot;</span> } <span class="ruby-keyword">if</span> <span class="ruby-identifier">deleted_deps</span>.<span class="ruby-identifier">any?</span>

  <span class="ruby-identifier">both_sources</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">h</span>, <span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-identifier">h</span>[<span class="ruby-identifier">k</span>] = [] }
  <span class="ruby-identifier">current_dependencies</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">d</span><span class="ruby-operator">|</span> <span class="ruby-identifier">both_sources</span>[<span class="ruby-identifier">d</span>.<span class="ruby-identifier">name</span>][<span class="ruby-value">0</span>] = <span class="ruby-identifier">d</span> }
  <span class="ruby-identifier">current_locked_dependencies</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">d</span><span class="ruby-operator">|</span> <span class="ruby-identifier">both_sources</span>[<span class="ruby-identifier">d</span>.<span class="ruby-identifier">name</span>][<span class="ruby-value">1</span>] = <span class="ruby-identifier">d</span> }

  <span class="ruby-identifier">both_sources</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span>, (<span class="ruby-identifier">dep</span>, <span class="ruby-identifier">lock_dep</span>)<span class="ruby-operator">|</span>
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">lock_dep</span>.<span class="ruby-identifier">nil?</span>

    <span class="ruby-identifier">gemfile_source</span> = <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">source</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">default_source</span>
    <span class="ruby-identifier">lock_source</span> = <span class="ruby-identifier">lock_dep</span>.<span class="ruby-identifier">source</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">default_source</span>
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">lock_source</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">gemfile_source</span>)

    <span class="ruby-identifier">gemfile_source_name</span> = <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">source</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">gemfile_source</span>.<span class="ruby-identifier">to_gemfile</span> <span class="ruby-operator">:</span> <span class="ruby-string">&quot;no specified source&quot;</span>
    <span class="ruby-identifier">lockfile_source_name</span> = <span class="ruby-identifier">lock_dep</span>.<span class="ruby-identifier">source</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">lock_source</span>.<span class="ruby-identifier">to_gemfile</span> <span class="ruby-operator">:</span> <span class="ruby-string">&quot;no specified source&quot;</span>
    <span class="ruby-identifier">changed</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;* #{name} from `#{lockfile_source_name}` to `#{gemfile_source_name}`&quot;</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">reason</span> = <span class="ruby-identifier">change_reason</span>
  <span class="ruby-identifier">msg</span> = <span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>
  <span class="ruby-identifier">msg</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;#{reason.capitalize.strip}, but the lockfile can&#39;t be updated because frozen mode is set&quot;</span>
  <span class="ruby-identifier">msg</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;\n\nYou have added to the Gemfile:\n&quot;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">added</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;\n&quot;</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">added</span>.<span class="ruby-identifier">any?</span>
  <span class="ruby-identifier">msg</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;\n\nYou have deleted from the Gemfile:\n&quot;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">deleted</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;\n&quot;</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">deleted</span>.<span class="ruby-identifier">any?</span>
  <span class="ruby-identifier">msg</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;\n\nYou have changed in the Gemfile:\n&quot;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">changed</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;\n&quot;</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">changed</span>.<span class="ruby-identifier">any?</span>
  <span class="ruby-identifier">msg</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;\n\nRun `bundle install` elsewhere and add the updated #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} to version control.\n&quot;</span>

  <span class="ruby-keyword">unless</span> <span class="ruby-identifier">explicit_flag</span>
    <span class="ruby-identifier">suggested_command</span> = <span class="ruby-keyword">unless</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>.<span class="ruby-identifier">locations</span>(<span class="ruby-string">&quot;frozen&quot;</span>).<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value">:env</span>)
      <span class="ruby-string">&quot;bundle config set frozen false&quot;</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">msg</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;If this is a development machine, remove the #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)} &quot;</span> \
           <span class="ruby-node">&quot;freeze by running `#{suggested_command}`.&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">suggested_command</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">raise</span> <span class="ruby-constant">ProductionError</span>, <span class="ruby-identifier">msg</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">added</span>.<span class="ruby-identifier">any?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">deleted</span>.<span class="ruby-identifier">any?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">changed</span>.<span class="ruby-identifier">any?</span> <span class="ruby-operator">||</span> <span class="ruby-operator">!</span><span class="ruby-identifier">nothing_changed?</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-filter_relevant" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">filter_relevant</span><span
                                class="method-args">(dependencies)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="filter_relevant-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 247</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">filter_relevant</span>(<span class="ruby-identifier">dependencies</span>)
  <span class="ruby-identifier">dependencies</span>.<span class="ruby-identifier">select</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">d</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">d</span>.<span class="ruby-identifier">should_include?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">d</span>.<span class="ruby-identifier">gem_platforms</span>([<span class="ruby-identifier">generic_local_platform</span>]).<span class="ruby-identifier">empty?</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-gem_version_promoter" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">gem_version_promoter</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="gem_version_promoter-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 155</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">gem_version_promoter</span>
  <span class="ruby-ivar">@gem_version_promoter</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">GemVersionPromoter</span>.<span class="ruby-identifier">new</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-groups" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">groups</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="groups-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 309</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">groups</span>
  <span class="ruby-identifier">dependencies</span>.<span class="ruby-identifier">map</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:groups</span>).<span class="ruby-identifier">flatten</span>.<span class="ruby-identifier">uniq</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-lock" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">lock</span><span
                                class="method-args">(file, preserve_unknown_sections = false)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="lock-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 313</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">lock</span>(<span class="ruby-identifier">file</span>, <span class="ruby-identifier">preserve_unknown_sections</span> = <span class="ruby-keyword">false</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">Definition</span>.<span class="ruby-identifier">no_lock</span>

  <span class="ruby-identifier">contents</span> = <span class="ruby-identifier">to_lock</span>

  <span class="ruby-comment"># Convert to \r\n if the existing lock has them</span>
  <span class="ruby-comment"># i.e., Windows with `git config core.autocrlf=true`</span>
  <span class="ruby-identifier">contents</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp">/\n/</span>, <span class="ruby-string">&quot;\r\n&quot;</span>) <span class="ruby-keyword">if</span> <span class="ruby-ivar">@lockfile_contents</span>.<span class="ruby-identifier">match?</span>(<span class="ruby-string">&quot;\r\n&quot;</span>)

  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@locked_bundler_version</span>
    <span class="ruby-identifier">locked_major</span> = <span class="ruby-ivar">@locked_bundler_version</span>.<span class="ruby-identifier">segments</span>.<span class="ruby-identifier">first</span>
    <span class="ruby-identifier">current_major</span> = <span class="ruby-identifier">bundler_version_to_lock</span>.<span class="ruby-identifier">segments</span>.<span class="ruby-identifier">first</span>

    <span class="ruby-identifier">updating_major</span> = <span class="ruby-identifier">locked_major</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">current_major</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">preserve_unknown_sections</span> <span class="ruby-operator">||=</span> <span class="ruby-operator">!</span><span class="ruby-identifier">updating_major</span> <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">frozen_bundle?</span> <span class="ruby-operator">||</span> <span class="ruby-operator">!</span>(<span class="ruby-identifier">unlocking?</span> <span class="ruby-operator">||</span> <span class="ruby-ivar">@unlocking_bundler</span>))

  <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">file</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">file</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">lockfiles_equal?</span>(<span class="ruby-ivar">@lockfile_contents</span>, <span class="ruby-identifier">contents</span>, <span class="ruby-identifier">preserve_unknown_sections</span>)

  <span class="ruby-keyword">if</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">frozen_bundle?</span>
    <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">error</span> <span class="ruby-string">&quot;Cannot write a changed lockfile while frozen.&quot;</span>
    <span class="ruby-keyword">return</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">filesystem_access</span>(<span class="ruby-identifier">file</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span>
    <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">p</span>, <span class="ruby-string">&quot;wb&quot;</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">puts</span>(<span class="ruby-identifier">contents</span>) }
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-locked_dependencies" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">locked_dependencies</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="locked_dependencies-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 253</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">locked_dependencies</span>
  <span class="ruby-ivar">@locked_deps</span>.<span class="ruby-identifier">values</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-locked_ruby_version" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">locked_ruby_version</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="locked_ruby_version-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 343</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">locked_ruby_version</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">ruby_version</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@unlock</span>[<span class="ruby-value">:ruby</span>] <span class="ruby-operator">||</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@locked_ruby_version</span>
    <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">RubyVersion</span>.<span class="ruby-identifier">system</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@locked_ruby_version</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-locked_ruby_version_object" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">locked_ruby_version_object</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="locked_ruby_version_object-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 352</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">locked_ruby_version_object</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@locked_ruby_version</span>
  <span class="ruby-ivar">@locked_ruby_version_object</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword">begin</span>
    <span class="ruby-keyword">unless</span> <span class="ruby-identifier">version</span> = <span class="ruby-constant">RubyVersion</span>.<span class="ruby-identifier">from_string</span>(<span class="ruby-ivar">@locked_ruby_version</span>)
      <span class="ruby-identifier">raise</span> <span class="ruby-constant">LockfileError</span>, <span class="ruby-node">&quot;The Ruby version #{@locked_ruby_version} from &quot;</span> \
        <span class="ruby-node">&quot;#{@lockfile} could not be parsed. &quot;</span> \
        <span class="ruby-string">&quot;Try running bundle update --ruby to resolve this.&quot;</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">version</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-missing_specs" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">missing_specs</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="missing_specs-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 211</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">missing_specs</span>
  <span class="ruby-identifier">resolve</span>.<span class="ruby-identifier">materialize</span>(<span class="ruby-identifier">requested_dependencies</span>).<span class="ruby-identifier">missing_specs</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-missing_specs-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">missing_specs?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="missing_specs-3F-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 215</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">missing_specs?</span>
  <span class="ruby-identifier">missing</span> = <span class="ruby-identifier">missing_specs</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">missing</span>.<span class="ruby-identifier">empty?</span>
  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">debug</span> <span class="ruby-node">&quot;The definition is missing #{missing.map(&amp;:full_name)}&quot;</span>
  <span class="ruby-keyword">true</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">BundlerError</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">e</span>
  <span class="ruby-ivar">@resolve</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@resolver</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@resolution_packages</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@specs</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@gem_version_promoter</span> = <span class="ruby-keyword">nil</span>

  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">debug</span> <span class="ruby-node">&quot;The definition is missing dependencies, failed to resolve &amp; materialize locally (#{e})&quot;</span>
  <span class="ruby-keyword">true</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-most_specific_locked_platform" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">most_specific_locked_platform</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="most_specific_locked_platform-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 471</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">most_specific_locked_platform</span>
  <span class="ruby-ivar">@platforms</span>.<span class="ruby-identifier">min_by</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">bundle_platform</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">platform_specificity_match</span>(<span class="ruby-identifier">bundle_platform</span>, <span class="ruby-identifier">local_platform</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-new_deps" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">new_deps</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="new_deps-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 257</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">new_deps</span>
  <span class="ruby-ivar">@new_deps</span> <span class="ruby-operator">||=</span> <span class="ruby-ivar">@dependencies</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">locked_dependencies</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-new_specs" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">new_specs</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="new_specs-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 203</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">new_specs</span>
  <span class="ruby-identifier">specs</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@locked_specs</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-no_resolve_needed-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">no_resolve_needed?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="no_resolve_needed-3F-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 484</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">no_resolve_needed?</span>
  <span class="ruby-operator">!</span><span class="ruby-identifier">unlocking?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">nothing_changed?</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-nothing_changed-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">nothing_changed?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="nothing_changed-3F-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 480</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">nothing_changed?</span>
  <span class="ruby-operator">!</span><span class="ruby-ivar">@source_changes</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@dependency_changes</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@new_platform</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@path_changes</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@local_changes</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@missing_lockfile_dep</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@unlocking_bundler</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-remove_platform" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">remove_platform</span><span
                                class="method-args">(platform)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="remove_platform-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 464</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">remove_platform</span>(<span class="ruby-identifier">platform</span>)
  <span class="ruby-identifier">removed_platform</span> = <span class="ruby-ivar">@platforms</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Platform</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">platform</span>))
  <span class="ruby-ivar">@removed_platform</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">removed_platform</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">removed_platform</span>
  <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidOption</span>, <span class="ruby-node">&quot;Unable to remove the platform `#{platform}` since the only platforms are #{@platforms.join &quot;, &quot;}&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-removed_specs" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">removed_specs</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="removed_specs-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 207</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">removed_specs</span>
  <span class="ruby-ivar">@locked_specs</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">specs</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-requested_dependencies" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">requested_dependencies</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="requested_dependencies-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 235</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">requested_dependencies</span>
  <span class="ruby-identifier">dependencies_for</span>(<span class="ruby-identifier">requested_groups</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-requested_specs" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">requested_specs</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="requested_specs-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 231</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">requested_specs</span>
  <span class="ruby-identifier">specs_for</span>(<span class="ruby-identifier">requested_groups</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-resolution_mode-3D" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">resolution_mode=</span><span
                                class="method-args">(options)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="resolution_mode-3D-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 176</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">resolution_mode=</span>(<span class="ruby-identifier">options</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-string">&quot;local&quot;</span>]
    <span class="ruby-ivar">@remote</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@remote</span> = <span class="ruby-keyword">true</span>
    <span class="ruby-ivar">@prefer_local</span> = <span class="ruby-identifier">options</span>[<span class="ruby-string">&quot;prefer-local&quot;</span>]
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-resolve" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">resolve</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Resolve all the dependencies specified in Gemfile. It ensures that dependencies that have been already resolved via locked file and are fresh are reused when resolving dependencies</p>

<p>@return [SpecSet] resolved dependencies</p>

                              <div class="method-source-code" id="resolve-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 283</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">resolve</span>
  <span class="ruby-ivar">@resolve</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">frozen_bundle?</span>
    <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">debug</span> <span class="ruby-string">&quot;Frozen, using resolution from the lockfile&quot;</span>
    <span class="ruby-ivar">@locked_specs</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">no_resolve_needed?</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">deleted_deps</span>.<span class="ruby-identifier">any?</span>
      <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">debug</span> <span class="ruby-string">&quot;Some dependencies were deleted, using a subset of the resolution from the lockfile&quot;</span>
      <span class="ruby-constant">SpecSet</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">filter_specs</span>(<span class="ruby-ivar">@locked_specs</span>, <span class="ruby-ivar">@dependencies</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">deleted_deps</span>))
    <span class="ruby-keyword">else</span>
      <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">debug</span> <span class="ruby-string">&quot;Found no changes, using resolution from the lockfile&quot;</span>
      <span class="ruby-keyword">if</span> <span class="ruby-ivar">@removed_platform</span> <span class="ruby-operator">||</span> <span class="ruby-ivar">@locked_gems</span>.<span class="ruby-identifier">may_include_redundant_platform_specific_gems?</span>
        <span class="ruby-constant">SpecSet</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">filter_specs</span>(<span class="ruby-ivar">@locked_specs</span>, <span class="ruby-ivar">@dependencies</span>))
      <span class="ruby-keyword">else</span>
        <span class="ruby-ivar">@locked_specs</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">debug</span> <span class="ruby-node">&quot;Found changes from the lockfile, re-resolving dependencies because #{change_reason}&quot;</span>
    <span class="ruby-identifier">start_resolution</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-resolve_only_locally-21" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">resolve_only_locally!</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="resolve_only_locally-21-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 159</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">resolve_only_locally!</span>
  <span class="ruby-ivar">@remote</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-identifier">sources</span>.<span class="ruby-identifier">local_only!</span>
  <span class="ruby-identifier">resolve</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-resolve_remotely-21" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">resolve_remotely!</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="resolve_remotely-21-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 170</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">resolve_remotely!</span>
  <span class="ruby-ivar">@remote</span> = <span class="ruby-keyword">true</span>
  <span class="ruby-identifier">sources</span>.<span class="ruby-identifier">remote!</span>
  <span class="ruby-identifier">resolve</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-resolve_with_cache-21" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">resolve_with_cache!</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="resolve_with_cache-21-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 165</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">resolve_with_cache!</span>
  <span class="ruby-identifier">sources</span>.<span class="ruby-identifier">cached!</span>
  <span class="ruby-identifier">resolve</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-setup_sources_for_resolve" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">setup_sources_for_resolve</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="setup_sources_for_resolve-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 185</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">setup_sources_for_resolve</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@remote</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">false</span>
    <span class="ruby-identifier">sources</span>.<span class="ruby-identifier">cached!</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">sources</span>.<span class="ruby-identifier">remote!</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-spec_git_paths" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">spec_git_paths</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="spec_git_paths-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 305</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">spec_git_paths</span>
  <span class="ruby-identifier">sources</span>.<span class="ruby-identifier">git_sources</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">realpath</span>(<span class="ruby-identifier">s</span>.<span class="ruby-identifier">path</span>) <span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">s</span>.<span class="ruby-identifier">path</span>) }.<span class="ruby-identifier">compact</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-specs" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">specs</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>For given dependency list returns a <a href="SpecSet.html"><code>SpecSet</code></a> with Gemspec of all the required dependencies.</p>

<pre>1. The method first resolves the dependencies specified in Gemfile
2. After that it tries and fetches gemspec of resolved dependencies</pre>

<p>@return [Bundler::SpecSet]</p>

                              <div class="method-source-code" id="specs-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 199</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">specs</span>
  <span class="ruby-ivar">@specs</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">materialize</span>(<span class="ruby-identifier">requested_dependencies</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-specs_for" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">specs_for</span><span
                                class="method-args">(groups)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="specs_for-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 265</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">specs_for</span>(<span class="ruby-identifier">groups</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-identifier">specs</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">groups</span>.<span class="ruby-identifier">empty?</span>
  <span class="ruby-identifier">deps</span> = <span class="ruby-identifier">dependencies_for</span>(<span class="ruby-identifier">groups</span>)
  <span class="ruby-identifier">materialize</span>(<span class="ruby-identifier">deps</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-to_lock" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">to_lock</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="to_lock-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 368</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_lock</span>
  <span class="ruby-identifier">require_relative</span> <span class="ruby-string">&quot;lockfile_generator&quot;</span>
  <span class="ruby-constant">LockfileGenerator</span>.<span class="ruby-identifier">generate</span>(<span class="ruby-keyword">self</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-unlocking-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">unlocking?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="unlocking-3F-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 488</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">unlocking?</span>
  <span class="ruby-ivar">@unlocking</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-validate_platforms-21" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">validate_platforms!</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="validate_platforms-21-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 451</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">validate_platforms!</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">current_platform_locked?</span>

  <span class="ruby-identifier">raise</span> <span class="ruby-constant">ProductionError</span>, <span class="ruby-node">&quot;Your bundle only supports platforms #{@platforms.map(&amp;:to_s)} &quot;</span> \
    <span class="ruby-node">&quot;but your local platform is #{Bundler.local_platform}. &quot;</span> \
    <span class="ruby-node">&quot;Add the current platform to the lockfile with\n`bundle lock --add-platform #{Bundler.local_platform}` and try again.&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-validate_ruby-21" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">validate_ruby!</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="validate_ruby-21-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 426</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">validate_ruby!</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">ruby_version</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">diff</span> = <span class="ruby-identifier">ruby_version</span>.<span class="ruby-identifier">diff</span>(<span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">RubyVersion</span>.<span class="ruby-identifier">system</span>)
    <span class="ruby-identifier">problem</span>, <span class="ruby-identifier">expected</span>, <span class="ruby-identifier">actual</span> = <span class="ruby-identifier">diff</span>

    <span class="ruby-identifier">msg</span> = <span class="ruby-keyword">case</span> <span class="ruby-identifier">problem</span>
          <span class="ruby-keyword">when</span> <span class="ruby-value">:engine</span>
            <span class="ruby-node">&quot;Your Ruby engine is #{actual}, but your Gemfile specified #{expected}&quot;</span>
          <span class="ruby-keyword">when</span> <span class="ruby-value">:version</span>
            <span class="ruby-node">&quot;Your Ruby version is #{actual}, but your Gemfile specified #{expected}&quot;</span>
          <span class="ruby-keyword">when</span> <span class="ruby-value">:engine_version</span>
            <span class="ruby-node">&quot;Your #{Bundler::RubyVersion.system.engine} version is #{actual}, but your Gemfile specified #{ruby_version.engine} #{expected}&quot;</span>
          <span class="ruby-keyword">when</span> <span class="ruby-value">:patchlevel</span>
            <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">expected</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
              <span class="ruby-string">&quot;The Ruby patchlevel in your Gemfile must be a string&quot;</span>
            <span class="ruby-keyword">else</span>
              <span class="ruby-node">&quot;Your Ruby patchlevel is #{actual}, but your Gemfile specified #{expected}&quot;</span>
            <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">raise</span> <span class="ruby-constant">RubyVersionMismatch</span>, <span class="ruby-identifier">msg</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-validate_runtime-21" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">validate_runtime!</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="validate_runtime-21-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 421</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">validate_runtime!</span>
  <span class="ruby-identifier">validate_ruby!</span>
  <span class="ruby-identifier">validate_platforms!</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="private-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Private Instance Methods</h3>
                </header>

                  <div id="method-i-add_current_platform" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">add_current_platform</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="add_current_platform-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 607</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">add_current_platform</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">current_ruby_platform_locked?</span>

  <span class="ruby-identifier">add_platform</span>(<span class="ruby-identifier">local_platform</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-additional_base_requirements_for_resolve" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">additional_base_requirements_for_resolve</span><span
                                class="method-args">(resolution_packages, last_resolve)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="additional_base_requirements_for_resolve-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 935</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">additional_base_requirements_for_resolve</span>(<span class="ruby-identifier">resolution_packages</span>, <span class="ruby-identifier">last_resolve</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-identifier">resolution_packages</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@locked_gems</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">sources</span>.<span class="ruby-identifier">expired_sources?</span>(<span class="ruby-ivar">@locked_gems</span>.<span class="ruby-identifier">sources</span>)
  <span class="ruby-identifier">converge_specs</span>(<span class="ruby-ivar">@originally_locked_specs</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">last_resolve</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">locked_spec</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">locked_spec</span>.<span class="ruby-identifier">source</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Source</span><span class="ruby-operator">::</span><span class="ruby-constant">Path</span>)
    <span class="ruby-identifier">resolution_packages</span>.<span class="ruby-identifier">base_requirements</span>[<span class="ruby-identifier">locked_spec</span>.<span class="ruby-identifier">name</span>] = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Requirement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;&gt;= #{locked_spec.version}&quot;</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">resolution_packages</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-change_reason" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">change_reason</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="change_reason-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 613</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">change_reason</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">unlocking?</span>
    <span class="ruby-identifier">unlock_reason</span> = <span class="ruby-ivar">@unlock</span>.<span class="ruby-identifier">reject</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">_k</span>, <span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-constant">Array</span>(<span class="ruby-identifier">v</span>).<span class="ruby-identifier">empty?</span> }.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">v</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">true</span>
        <span class="ruby-identifier">k</span>.<span class="ruby-identifier">to_s</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-identifier">v</span> = <span class="ruby-constant">Array</span>(<span class="ruby-identifier">v</span>)
        <span class="ruby-node">&quot;#{k}: (#{v.join(&quot;, &quot;)})&quot;</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;, &quot;</span>)
    <span class="ruby-keyword">return</span> <span class="ruby-node">&quot;bundler is unlocking #{unlock_reason}&quot;</span>
  <span class="ruby-keyword">end</span>
  [
    [<span class="ruby-ivar">@source_changes</span>, <span class="ruby-string">&quot;the list of sources changed&quot;</span>],
    [<span class="ruby-ivar">@dependency_changes</span>, <span class="ruby-string">&quot;the dependencies in your gemfile changed&quot;</span>],
    [<span class="ruby-ivar">@new_platform</span>, <span class="ruby-string">&quot;you added a new platform to your gemfile&quot;</span>],
    [<span class="ruby-ivar">@path_changes</span>, <span class="ruby-string">&quot;the gemspecs for path gems changed&quot;</span>],
    [<span class="ruby-ivar">@local_changes</span>, <span class="ruby-string">&quot;the gemspecs for git local gems changed&quot;</span>],
    [<span class="ruby-ivar">@missing_lockfile_dep</span>, <span class="ruby-node">&quot;your lock file is missing \&quot;#{@missing_lockfile_dep}\&quot;&quot;</span>],
    [<span class="ruby-ivar">@unlocking_bundler</span>, <span class="ruby-string">&quot;an update to the version of Bundler itself was requested&quot;</span>],
  ].<span class="ruby-identifier">select</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:first</span>).<span class="ruby-identifier">map</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:last</span>).<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;, &quot;</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-check_missing_lockfile_dep" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">check_missing_lockfile_dep</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="check_missing_lockfile_dep-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 687</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">check_missing_lockfile_dep</span>
  <span class="ruby-identifier">all_locked_specs</span> = <span class="ruby-ivar">@locked_specs</span>.<span class="ruby-identifier">map</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:name</span>) <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;bundler&quot;</span>

  <span class="ruby-identifier">missing</span> = <span class="ruby-ivar">@locked_specs</span>.<span class="ruby-identifier">select</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">s</span>.<span class="ruby-identifier">dependencies</span>.<span class="ruby-identifier">any?</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">dep</span><span class="ruby-operator">|</span> <span class="ruby-operator">!</span><span class="ruby-identifier">all_locked_specs</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">dep</span>.<span class="ruby-identifier">name</span>) }
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">missing</span>.<span class="ruby-identifier">any?</span>
    <span class="ruby-ivar">@locked_specs</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">missing</span>)

    <span class="ruby-keyword">return</span> <span class="ruby-identifier">missing</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">name</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@dependency_changes</span>

  <span class="ruby-identifier">current_dependencies</span>.<span class="ruby-identifier">find</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">d</span><span class="ruby-operator">|</span>
    <span class="ruby-ivar">@locked_specs</span>[<span class="ruby-identifier">d</span>.<span class="ruby-identifier">name</span>].<span class="ruby-identifier">empty?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">d</span>.<span class="ruby-identifier">name</span> <span class="ruby-operator">!=</span> <span class="ruby-string">&quot;bundler&quot;</span>
  <span class="ruby-keyword">end</span>&amp;.<span class="ruby-identifier">name</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-converge_dependencies" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">converge_dependencies</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="converge_dependencies-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 752</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">converge_dependencies</span>
  <span class="ruby-identifier">changes</span> = <span class="ruby-keyword">false</span>

  <span class="ruby-ivar">@dependencies</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">dep</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">source</span>
      <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">source</span> = <span class="ruby-identifier">sources</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">dep</span>.<span class="ruby-identifier">source</span>)
    <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">unlocking?</span>

    <span class="ruby-keyword">unless</span> <span class="ruby-identifier">locked_dep</span> = <span class="ruby-ivar">@locked_deps</span>[<span class="ruby-identifier">dep</span>.<span class="ruby-identifier">name</span>]
      <span class="ruby-identifier">changes</span> = <span class="ruby-keyword">true</span>
      <span class="ruby-keyword">next</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-comment"># Gem::Dependency#== matches Gem::Dependency#type. As the lockfile</span>
    <span class="ruby-comment"># doesn&#39;t carry a notion of the dependency type, if you use</span>
    <span class="ruby-comment"># add_development_dependency in a gemspec that&#39;s loaded with the gemspec</span>
    <span class="ruby-comment"># directive, the lockfile dependencies and resolved dependencies end up</span>
    <span class="ruby-comment"># with a mismatch on #type. Work around that by setting the type on the</span>
    <span class="ruby-comment"># dep from the lockfile.</span>
    <span class="ruby-identifier">locked_dep</span>.<span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-value">:@type</span>, <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">type</span>)

    <span class="ruby-comment"># We already know the name matches from the hash lookup</span>
    <span class="ruby-comment"># so we only need to check the requirement now</span>
    <span class="ruby-identifier">changes</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">requirement</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">locked_dep</span>.<span class="ruby-identifier">requirement</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">changes</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-converge_locals" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">converge_locals</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Get all locals and override their matching sources. Return true if any of the locals changed (for example, they point to a new revision) or depend on new specs.</p>

                              <div class="method-source-code" id="converge_locals-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 669</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">converge_locals</span>
  <span class="ruby-identifier">locals</span> = []

  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>.<span class="ruby-identifier">local_overrides</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">spec</span>   = <span class="ruby-ivar">@dependencies</span>.<span class="ruby-identifier">find</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">k</span> }
    <span class="ruby-identifier">source</span> = <span class="ruby-identifier">spec</span>&amp;.<span class="ruby-identifier">source</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">source</span>&amp;.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:local_override!</span>)
      <span class="ruby-identifier">source</span>.<span class="ruby-identifier">unlock!</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@unlock</span>[<span class="ruby-value">:gems</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">name</span>)
      <span class="ruby-identifier">locals</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">source</span>, <span class="ruby-identifier">source</span>.<span class="ruby-identifier">local_override!</span>(<span class="ruby-identifier">v</span>)]
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">sources_with_changes</span> = <span class="ruby-identifier">locals</span>.<span class="ruby-identifier">select</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">source</span>, <span class="ruby-identifier">changed</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">changed</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">specs_changed?</span>(<span class="ruby-identifier">source</span>)
  <span class="ruby-keyword">end</span>.<span class="ruby-identifier">map</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:first</span>)
  <span class="ruby-operator">!</span><span class="ruby-identifier">sources_with_changes</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">source</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@unlock</span>[<span class="ruby-value">:sources</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">source</span>.<span class="ruby-identifier">name</span> }.<span class="ruby-identifier">empty?</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-converge_locked_specs" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">converge_locked_specs</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Remove elements from the locked specs that are expired. This will most commonly happen if the Gemfile has changed since the lockfile was last generated</p>

                              <div class="method-source-code" id="converge_locked_specs-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 786</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">converge_locked_specs</span>
  <span class="ruby-identifier">converged</span> = <span class="ruby-identifier">converge_specs</span>(<span class="ruby-ivar">@locked_specs</span>)

  <span class="ruby-identifier">resolve</span> = <span class="ruby-constant">SpecSet</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">converged</span>.<span class="ruby-identifier">reject</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@unlock</span>[<span class="ruby-value">:gems</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">s</span>.<span class="ruby-identifier">name</span>) })

  <span class="ruby-identifier">diff</span> = <span class="ruby-keyword">nil</span>

  <span class="ruby-comment"># Now, we unlock any sources that do not have anymore gems pinned to it</span>
  <span class="ruby-identifier">sources</span>.<span class="ruby-identifier">all_sources</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">source</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">source</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:unlock!</span>)

    <span class="ruby-keyword">unless</span> <span class="ruby-identifier">resolve</span>.<span class="ruby-identifier">any?</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">source</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">source</span> }
      <span class="ruby-identifier">diff</span> <span class="ruby-operator">||=</span> <span class="ruby-ivar">@locked_specs</span>.<span class="ruby-identifier">to_a</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">resolve</span>.<span class="ruby-identifier">to_a</span>
      <span class="ruby-identifier">source</span>.<span class="ruby-identifier">unlock!</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">diff</span>.<span class="ruby-identifier">any?</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">source</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">source</span> }
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">resolve</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-converge_path_source_to_gemspec_source" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">converge_path_source_to_gemspec_source</span><span
                                class="method-args">(source)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="converge_path_source_to_gemspec_source-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 713</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">converge_path_source_to_gemspec_source</span>(<span class="ruby-identifier">source</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-identifier">source</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">source</span>.<span class="ruby-identifier">instance_of?</span>(<span class="ruby-constant">Source</span><span class="ruby-operator">::</span><span class="ruby-constant">Path</span>)
  <span class="ruby-identifier">gemspec_source</span> = <span class="ruby-identifier">sources</span>.<span class="ruby-identifier">path_sources</span>.<span class="ruby-identifier">find</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Source</span><span class="ruby-operator">::</span><span class="ruby-constant">Gemspec</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">as_path_source</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">source</span> }
  <span class="ruby-identifier">gemspec_source</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">source</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-converge_path_sources_to_gemspec_sources" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">converge_path_sources_to_gemspec_sources</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="converge_path_sources_to_gemspec_sources-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 719</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">converge_path_sources_to_gemspec_sources</span>
  <span class="ruby-ivar">@locked_sources</span>.<span class="ruby-identifier">map!</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">source</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">converge_path_source_to_gemspec_source</span>(<span class="ruby-identifier">source</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@locked_specs</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">spec</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">source</span> <span class="ruby-operator">&amp;&amp;=</span> <span class="ruby-identifier">converge_path_source_to_gemspec_source</span>(<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">source</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@locked_deps</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">_</span>, <span class="ruby-identifier">dep</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">source</span> <span class="ruby-operator">&amp;&amp;=</span> <span class="ruby-identifier">converge_path_source_to_gemspec_source</span>(<span class="ruby-identifier">dep</span>.<span class="ruby-identifier">source</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-converge_paths" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">converge_paths</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="converge_paths-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 707</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">converge_paths</span>
  <span class="ruby-identifier">sources</span>.<span class="ruby-identifier">path_sources</span>.<span class="ruby-identifier">any?</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">source</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">specs_changed?</span>(<span class="ruby-identifier">source</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-converge_sources" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">converge_sources</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="converge_sources-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 731</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">converge_sources</span>
  <span class="ruby-comment"># Replace the sources from the Gemfile with the sources from the Gemfile.lock,</span>
  <span class="ruby-comment"># if they exist in the Gemfile.lock and are `==`. If you can&#39;t find an equivalent</span>
  <span class="ruby-comment"># source in the Gemfile.lock, use the one from the Gemfile.</span>
  <span class="ruby-identifier">changes</span> = <span class="ruby-identifier">sources</span>.<span class="ruby-identifier">replace_sources!</span>(<span class="ruby-ivar">@locked_sources</span>)

  <span class="ruby-identifier">sources</span>.<span class="ruby-identifier">all_sources</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">source</span><span class="ruby-operator">|</span>
    <span class="ruby-comment"># If the source is unlockable and the current command allows an unlock of</span>
    <span class="ruby-comment"># the source (for example, you are doing a `bundle update &lt;foo&gt;` of a git-pinned</span>
    <span class="ruby-comment"># gem), unlock it. For git sources, this means to unlock the revision, which</span>
    <span class="ruby-comment"># will cause the `ref` used to be the most recent for the branch (or master) if</span>
    <span class="ruby-comment"># an explicit `ref` is not used.</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">source</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:unlock!</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@unlock</span>[<span class="ruby-value">:sources</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">source</span>.<span class="ruby-identifier">name</span>)
      <span class="ruby-identifier">source</span>.<span class="ruby-identifier">unlock!</span>
      <span class="ruby-identifier">changes</span> = <span class="ruby-keyword">true</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">changes</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-converge_specs" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">converge_specs</span><span
                                class="method-args">(specs)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="converge_specs-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 806</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">converge_specs</span>(<span class="ruby-identifier">specs</span>)
  <span class="ruby-identifier">converged</span> = []
  <span class="ruby-identifier">deps</span> = []

  <span class="ruby-ivar">@specs_that_changed_sources</span> = []

  <span class="ruby-identifier">specs</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">name</span> = <span class="ruby-identifier">s</span>.<span class="ruby-identifier">name</span>
    <span class="ruby-identifier">dep</span> = <span class="ruby-ivar">@dependencies</span>.<span class="ruby-identifier">find</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">d</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">satisfies?</span>(<span class="ruby-identifier">d</span>) }
    <span class="ruby-identifier">lockfile_source</span> = <span class="ruby-identifier">s</span>.<span class="ruby-identifier">source</span>

    <span class="ruby-keyword">if</span> <span class="ruby-identifier">dep</span>
      <span class="ruby-identifier">gemfile_source</span> = <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">source</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">default_source</span>

      <span class="ruby-ivar">@specs_that_changed_sources</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">s</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">gemfile_source</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">lockfile_source</span>
      <span class="ruby-identifier">deps</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">dep</span> <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">dep</span>.<span class="ruby-identifier">source</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">lockfile_source</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">dep</span>.<span class="ruby-identifier">source</span>)
      <span class="ruby-ivar">@unlock</span>[<span class="ruby-value">:gems</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">name</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">lockfile_source</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">dep</span>.<span class="ruby-identifier">source</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">lockfile_source</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">gemfile_source</span>

      <span class="ruby-comment"># Replace the locked dependency&#39;s source with the equivalent source from the Gemfile</span>
      <span class="ruby-identifier">s</span>.<span class="ruby-identifier">source</span> = <span class="ruby-identifier">gemfile_source</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-comment"># Replace the locked dependency&#39;s source with the default source, if the locked source is no longer in the Gemfile</span>
      <span class="ruby-identifier">s</span>.<span class="ruby-identifier">source</span> = <span class="ruby-identifier">default_source</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">sources</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">lockfile_source</span>)
    <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@unlock</span>[<span class="ruby-value">:sources</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">s</span>.<span class="ruby-identifier">source</span>.<span class="ruby-identifier">name</span>)

    <span class="ruby-comment"># Path sources have special logic</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">source</span>.<span class="ruby-identifier">instance_of?</span>(<span class="ruby-constant">Source</span><span class="ruby-operator">::</span><span class="ruby-constant">Path</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">source</span>.<span class="ruby-identifier">instance_of?</span>(<span class="ruby-constant">Source</span><span class="ruby-operator">::</span><span class="ruby-constant">Gemspec</span>)
      <span class="ruby-identifier">new_specs</span> = <span class="ruby-keyword">begin</span>
        <span class="ruby-identifier">s</span>.<span class="ruby-identifier">source</span>.<span class="ruby-identifier">specs</span>
      <span class="ruby-keyword">rescue</span> <span class="ruby-constant">PathError</span>
        <span class="ruby-comment"># if we won&#39;t need the source (according to the lockfile),</span>
        <span class="ruby-comment"># don&#39;t error if the path source isn&#39;t available</span>
        <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">specs</span>.
                <span class="ruby-identifier">for</span>(<span class="ruby-identifier">requested_dependencies</span>, <span class="ruby-keyword">false</span>).
                <span class="ruby-identifier">none?</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">locked_spec</span><span class="ruby-operator">|</span> <span class="ruby-identifier">locked_spec</span>.<span class="ruby-identifier">source</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">source</span> }

        <span class="ruby-identifier">raise</span>
      <span class="ruby-keyword">end</span>

      <span class="ruby-identifier">new_spec</span> = <span class="ruby-identifier">new_specs</span>[<span class="ruby-identifier">s</span>].<span class="ruby-identifier">first</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">new_spec</span>
        <span class="ruby-identifier">s</span>.<span class="ruby-identifier">dependencies</span>.<span class="ruby-identifier">replace</span>(<span class="ruby-identifier">new_spec</span>.<span class="ruby-identifier">dependencies</span>)
      <span class="ruby-keyword">else</span>
        <span class="ruby-comment"># If the spec is no longer in the path source, unlock it. This</span>
        <span class="ruby-comment"># commonly happens if the version changed in the gemspec</span>
        <span class="ruby-ivar">@unlock</span>[<span class="ruby-value">:gems</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">name</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">if</span> <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">requested_dependencies</span>.<span class="ruby-identifier">find</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">d</span><span class="ruby-operator">|</span> <span class="ruby-identifier">name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">d</span>.<span class="ruby-identifier">name</span> }
      <span class="ruby-ivar">@unlock</span>[<span class="ruby-value">:gems</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">name</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">converged</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">s</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">filter_specs</span>(<span class="ruby-identifier">converged</span>, <span class="ruby-identifier">deps</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-current_platform_locked-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">current_platform_locked?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="current_platform_locked-3F-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 601</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">current_platform_locked?</span>
  <span class="ruby-ivar">@platforms</span>.<span class="ruby-identifier">any?</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">bundle_platform</span><span class="ruby-operator">|</span>
    <span class="ruby-constant">MatchPlatform</span>.<span class="ruby-identifier">platforms_match?</span>(<span class="ruby-identifier">bundle_platform</span>, <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">local_platform</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-current_ruby_platform_locked-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">current_ruby_platform_locked?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="current_ruby_platform_locked-3F-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 594</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">current_ruby_platform_locked?</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">generic_local_platform</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Platform</span><span class="ruby-operator">::</span><span class="ruby-constant">RUBY</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>[<span class="ruby-value">:force_ruby_platform</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@platforms</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Platform</span><span class="ruby-operator">::</span><span class="ruby-constant">RUBY</span>)

  <span class="ruby-identifier">current_platform_locked?</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-default_source" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">default_source</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="default_source-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 903</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">default_source</span>
  <span class="ruby-identifier">sources</span>.<span class="ruby-identifier">default_source</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-dependencies_for_source_changed-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">dependencies_for_source_changed?</span><span
                                class="method-args">(source, locked_source = source)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="dependencies_for_source_changed-3F-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 648</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">dependencies_for_source_changed?</span>(<span class="ruby-identifier">source</span>, <span class="ruby-identifier">locked_source</span> = <span class="ruby-identifier">source</span>)
  <span class="ruby-identifier">deps_for_source</span> = <span class="ruby-ivar">@dependencies</span>.<span class="ruby-identifier">select</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">source</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">source</span> }
  <span class="ruby-identifier">locked_deps_for_source</span> = <span class="ruby-identifier">locked_dependencies</span>.<span class="ruby-identifier">select</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">dep</span><span class="ruby-operator">|</span> <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">source</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">locked_source</span> }

  <span class="ruby-identifier">deps_for_source</span>.<span class="ruby-identifier">uniq</span>.<span class="ruby-identifier">sort</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">locked_deps_for_source</span>.<span class="ruby-identifier">sort</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-dependencies_with_bundler" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">dependencies_with_bundler</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="dependencies_with_bundler-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 502</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">dependencies_with_bundler</span>
  <span class="ruby-keyword">return</span> <span class="ruby-identifier">dependencies</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@unlocking_bundler</span>
  <span class="ruby-keyword">return</span> <span class="ruby-identifier">dependencies</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">dependencies</span>.<span class="ruby-identifier">map</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:name</span>).<span class="ruby-identifier">include?</span>(<span class="ruby-string">&quot;bundler&quot;</span>)

  [<span class="ruby-constant">Dependency</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&quot;bundler&quot;</span>, <span class="ruby-ivar">@unlocking_bundler</span>)] <span class="ruby-operator">+</span> <span class="ruby-identifier">dependencies</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-expanded_dependencies" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">expanded_dependencies</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="expanded_dependencies-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 498</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">expanded_dependencies</span>
  <span class="ruby-identifier">dependencies_with_bundler</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">metadata_dependencies</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-filter_specs" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">filter_specs</span><span
                                class="method-args">(specs, deps)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="filter_specs-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 518</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">filter_specs</span>(<span class="ruby-identifier">specs</span>, <span class="ruby-identifier">deps</span>)
  <span class="ruby-constant">SpecSet</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">specs</span>).<span class="ruby-identifier">for</span>(<span class="ruby-identifier">deps</span>, <span class="ruby-keyword">false</span>, <span class="ruby-identifier">platforms</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-lockfiles_equal-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">lockfiles_equal?</span><span
                                class="method-args">(current, proposed, preserve_unknown_sections)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="lockfiles_equal-3F-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 921</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">lockfiles_equal?</span>(<span class="ruby-identifier">current</span>, <span class="ruby-identifier">proposed</span>, <span class="ruby-identifier">preserve_unknown_sections</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">preserve_unknown_sections</span>
    <span class="ruby-identifier">sections_to_ignore</span> = <span class="ruby-constant">LockfileParser</span>.<span class="ruby-identifier">sections_to_ignore</span>(<span class="ruby-ivar">@locked_bundler_version</span>)
    <span class="ruby-identifier">sections_to_ignore</span> <span class="ruby-operator">+=</span> <span class="ruby-constant">LockfileParser</span>.<span class="ruby-identifier">unknown_sections_in_lockfile</span>(<span class="ruby-identifier">current</span>)
    <span class="ruby-identifier">sections_to_ignore</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">LockfileParser</span><span class="ruby-operator">::</span><span class="ruby-constant">RUBY</span>
    <span class="ruby-identifier">sections_to_ignore</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">LockfileParser</span><span class="ruby-operator">::</span><span class="ruby-constant">BUNDLED</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@unlocking_bundler</span>
    <span class="ruby-identifier">pattern</span> = <span class="ruby-regexp">/#{Regexp.union(sections_to_ignore)}\n(\s{2,}.*\n)+/</span>
    <span class="ruby-identifier">whitespace_cleanup</span> = <span class="ruby-regexp">/\n{2,}/</span>
    <span class="ruby-identifier">current</span> = <span class="ruby-identifier">current</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-identifier">pattern</span>, <span class="ruby-string">&quot;\n&quot;</span>).<span class="ruby-identifier">gsub</span>(<span class="ruby-identifier">whitespace_cleanup</span>, <span class="ruby-string">&quot;\n\n&quot;</span>).<span class="ruby-identifier">strip</span>
    <span class="ruby-identifier">proposed</span> = <span class="ruby-identifier">proposed</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-identifier">pattern</span>, <span class="ruby-string">&quot;\n&quot;</span>).<span class="ruby-identifier">gsub</span>(<span class="ruby-identifier">whitespace_cleanup</span>, <span class="ruby-string">&quot;\n\n&quot;</span>).<span class="ruby-identifier">strip</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">current</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">proposed</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-materialize" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">materialize</span><span
                                class="method-args">(dependencies)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="materialize-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 522</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">materialize</span>(<span class="ruby-identifier">dependencies</span>)
  <span class="ruby-identifier">specs</span> = <span class="ruby-identifier">resolve</span>.<span class="ruby-identifier">materialize</span>(<span class="ruby-identifier">dependencies</span>)
  <span class="ruby-identifier">missing_specs</span> = <span class="ruby-identifier">specs</span>.<span class="ruby-identifier">missing_specs</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">missing_specs</span>.<span class="ruby-identifier">any?</span>
    <span class="ruby-identifier">missing_specs</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">locked_gem</span> = <span class="ruby-ivar">@locked_specs</span>[<span class="ruby-identifier">s</span>.<span class="ruby-identifier">name</span>].<span class="ruby-identifier">last</span>
      <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">locked_gem</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">locked_gem</span>.<span class="ruby-identifier">version</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">version</span> <span class="ruby-operator">||</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@remote</span>
      <span class="ruby-identifier">raise</span> <span class="ruby-constant">GemNotFound</span>, <span class="ruby-node">&quot;Your bundle is locked to #{locked_gem} from #{locked_gem.source}, but that version can &quot;</span> \
                         <span class="ruby-node">&quot;no longer be found in that source. That means the author of #{locked_gem} has removed it. &quot;</span> \
                         <span class="ruby-node">&quot;You&#39;ll need to update your bundle to a version other than #{locked_gem} that hasn&#39;t been &quot;</span> \
                         <span class="ruby-string">&quot;removed in order to install.&quot;</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">missing_specs_list</span> = <span class="ruby-identifier">missing_specs</span>.<span class="ruby-identifier">group_by</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:source</span>).<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">source</span>, <span class="ruby-identifier">missing_specs_for_source</span><span class="ruby-operator">|</span>
      <span class="ruby-node">&quot;#{missing_specs_for_source.map(&amp;:full_name).join(&quot;, &quot;)} in #{source}&quot;</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">raise</span> <span class="ruby-constant">GemNotFound</span>, <span class="ruby-node">&quot;Could not find #{missing_specs_list.join(&quot; nor &quot;)}&quot;</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">incomplete_specs</span> = <span class="ruby-identifier">specs</span>.<span class="ruby-identifier">incomplete_specs</span>
  <span class="ruby-identifier">loop</span> <span class="ruby-keyword">do</span>
    <span class="ruby-keyword">break</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">incomplete_specs</span>.<span class="ruby-identifier">empty?</span>

    <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-string">&quot;The lockfile does not have all gems needed for the current platform though, Bundler will still re-resolve dependencies&quot;</span>)
    <span class="ruby-identifier">setup_sources_for_resolve</span>
    <span class="ruby-identifier">resolution_packages</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">incomplete_specs</span>)
    <span class="ruby-ivar">@resolve</span> = <span class="ruby-identifier">start_resolution</span>
    <span class="ruby-identifier">specs</span> = <span class="ruby-identifier">resolve</span>.<span class="ruby-identifier">materialize</span>(<span class="ruby-identifier">dependencies</span>)

    <span class="ruby-identifier">still_incomplete_specs</span> = <span class="ruby-identifier">specs</span>.<span class="ruby-identifier">incomplete_specs</span>

    <span class="ruby-keyword">if</span> <span class="ruby-identifier">still_incomplete_specs</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">incomplete_specs</span>
      <span class="ruby-identifier">package</span> = <span class="ruby-identifier">resolution_packages</span>.<span class="ruby-identifier">get_package</span>(<span class="ruby-identifier">incomplete_specs</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">name</span>)
      <span class="ruby-identifier">resolver</span>.<span class="ruby-identifier">raise_not_found!</span> <span class="ruby-identifier">package</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">incomplete_specs</span> = <span class="ruby-identifier">still_incomplete_specs</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">bundler</span> = <span class="ruby-identifier">sources</span>.<span class="ruby-identifier">metadata_source</span>.<span class="ruby-identifier">specs</span>.<span class="ruby-identifier">search</span>([<span class="ruby-string">&quot;bundler&quot;</span>, <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">gem_version</span>]).<span class="ruby-identifier">last</span>
  <span class="ruby-identifier">specs</span>[<span class="ruby-string">&quot;bundler&quot;</span>] = <span class="ruby-identifier">bundler</span>

  <span class="ruby-identifier">specs</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-metadata_dependencies" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">metadata_dependencies</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="metadata_dependencies-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 867</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">metadata_dependencies</span>
  <span class="ruby-ivar">@metadata_dependencies</span> <span class="ruby-operator">||=</span> [
    <span class="ruby-constant">Dependency</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&quot;Ruby\0&quot;</span>, <span class="ruby-constant">Gem</span>.<span class="ruby-identifier">ruby_version</span>),
    <span class="ruby-constant">Dependency</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&quot;RubyGems\0&quot;</span>, <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">VERSION</span>),
  ]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-pin_locally_available_names" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">pin_locally_available_names</span><span
                                class="method-args">(source_requirements)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="pin_locally_available_names-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 581</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">pin_locally_available_names</span>(<span class="ruby-identifier">source_requirements</span>)
  <span class="ruby-identifier">source_requirements</span>.<span class="ruby-identifier">each_with_object</span>({}) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">original_source</span>), <span class="ruby-identifier">new_source_requirements</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">local_source</span> = <span class="ruby-identifier">original_source</span>.<span class="ruby-identifier">dup</span>
    <span class="ruby-identifier">local_source</span>.<span class="ruby-identifier">local_only!</span>

    <span class="ruby-identifier">new_source_requirements</span>[<span class="ruby-identifier">name</span>] = <span class="ruby-keyword">if</span> <span class="ruby-identifier">local_source</span>.<span class="ruby-identifier">specs</span>.<span class="ruby-identifier">search</span>(<span class="ruby-identifier">name</span>).<span class="ruby-identifier">any?</span>
      <span class="ruby-identifier">local_source</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">original_source</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-precompute_source_requirements_for_indirect_dependencies-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">precompute_source_requirements_for_indirect_dependencies?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="precompute_source_requirements_for_indirect_dependencies-3F-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 577</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">precompute_source_requirements_for_indirect_dependencies?</span>
  <span class="ruby-identifier">sources</span>.<span class="ruby-identifier">non_global_rubygems_sources</span>.<span class="ruby-identifier">all?</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:dependency_api_available?</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">sources</span>.<span class="ruby-identifier">aggregate_global_source?</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-pretty_dep" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">pretty_dep</span><span
                                class="method-args">(dep)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="pretty_dep-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 636</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">pretty_dep</span>(<span class="ruby-identifier">dep</span>)
  <span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">pretty_dependency</span>(<span class="ruby-identifier">dep</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-remove_ruby_from_platforms_if_necessary-21" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">remove_ruby_from_platforms_if_necessary!</span><span
                                class="method-args">(dependencies)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="remove_ruby_from_platforms_if_necessary-21-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 944</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">remove_ruby_from_platforms_if_necessary!</span>(<span class="ruby-identifier">dependencies</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">frozen_bundle?</span> <span class="ruby-operator">||</span>
            <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">local_platform</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Platform</span><span class="ruby-operator">::</span><span class="ruby-constant">RUBY</span> <span class="ruby-operator">||</span>
            <span class="ruby-operator">!</span><span class="ruby-identifier">platforms</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Platform</span><span class="ruby-operator">::</span><span class="ruby-constant">RUBY</span>) <span class="ruby-operator">||</span>
            (<span class="ruby-ivar">@new_platform</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">platforms</span>.<span class="ruby-identifier">last</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Platform</span><span class="ruby-operator">::</span><span class="ruby-constant">RUBY</span>) <span class="ruby-operator">||</span>
            <span class="ruby-ivar">@path_changes</span> <span class="ruby-operator">||</span>
            <span class="ruby-ivar">@dependency_changes</span> <span class="ruby-operator">||</span>
            <span class="ruby-operator">!</span><span class="ruby-ivar">@originally_locked_specs</span>.<span class="ruby-identifier">incomplete_ruby_specs?</span>(<span class="ruby-identifier">dependencies</span>)

  <span class="ruby-identifier">remove_platform</span>(<span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Platform</span><span class="ruby-operator">::</span><span class="ruby-constant">RUBY</span>)
  <span class="ruby-identifier">add_current_platform</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-requested_groups" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">requested_groups</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="requested_groups-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 915</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">requested_groups</span>
  <span class="ruby-identifier">values</span> = <span class="ruby-identifier">groups</span> <span class="ruby-operator">-</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>[<span class="ruby-value">:without</span>] <span class="ruby-operator">-</span> <span class="ruby-ivar">@optional_groups</span> <span class="ruby-operator">+</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>[<span class="ruby-value">:with</span>]
  <span class="ruby-identifier">values</span> <span class="ruby-operator">&amp;=</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>[<span class="ruby-value">:only</span>] <span class="ruby-keyword">unless</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>[<span class="ruby-value">:only</span>].<span class="ruby-identifier">empty?</span>
  <span class="ruby-identifier">values</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-resolution_packages" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">resolution_packages</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="resolution_packages-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 509</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">resolution_packages</span>
  <span class="ruby-ivar">@resolution_packages</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword">begin</span>
    <span class="ruby-identifier">last_resolve</span> = <span class="ruby-identifier">converge_locked_specs</span>
    <span class="ruby-identifier">remove_ruby_from_platforms_if_necessary!</span>(<span class="ruby-identifier">current_dependencies</span>)
    <span class="ruby-identifier">packages</span> = <span class="ruby-constant">Resolver</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">source_requirements</span>, <span class="ruby-identifier">expanded_dependencies</span>, <span class="ruby-identifier">last_resolve</span>, <span class="ruby-ivar">@platforms</span>, <span class="ruby-value">:locked_specs</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-ivar">@originally_locked_specs</span>, <span class="ruby-value">:unlock</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-ivar">@unlock</span>[<span class="ruby-value">:gems</span>], <span class="ruby-value">:prerelease</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">gem_version_promoter</span>.<span class="ruby-identifier">pre?</span>)
    <span class="ruby-identifier">additional_base_requirements_for_resolve</span>(<span class="ruby-identifier">packages</span>, <span class="ruby-identifier">last_resolve</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-resolver" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">resolver</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="resolver-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 494</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">resolver</span>
  <span class="ruby-ivar">@resolver</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Resolver</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">resolution_packages</span>, <span class="ruby-identifier">gem_version_promoter</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-source_map" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">source_map</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="source_map-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 957</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">source_map</span>
  <span class="ruby-ivar">@source_map</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">SourceMap</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">sources</span>, <span class="ruby-identifier">dependencies</span>, <span class="ruby-ivar">@locked_specs</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-source_requirements" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">source_requirements</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="source_requirements-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 874</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">source_requirements</span>
  <span class="ruby-comment"># Record the specs available in each gem&#39;s source, so that those</span>
  <span class="ruby-comment"># specs will be available later when the resolver knows where to</span>
  <span class="ruby-comment"># look for that gemspec (or its dependencies)</span>
  <span class="ruby-identifier">source_requirements</span> = <span class="ruby-keyword">if</span> <span class="ruby-identifier">precompute_source_requirements_for_indirect_dependencies?</span>
    <span class="ruby-identifier">all_requirements</span> = <span class="ruby-identifier">source_map</span>.<span class="ruby-identifier">all_requirements</span>
    <span class="ruby-identifier">all_requirements</span> = <span class="ruby-identifier">pin_locally_available_names</span>(<span class="ruby-identifier">all_requirements</span>) <span class="ruby-keyword">if</span> <span class="ruby-ivar">@prefer_local</span>
    { <span class="ruby-value">:default</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">default_source</span> }.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">all_requirements</span>)
  <span class="ruby-keyword">else</span>
    { <span class="ruby-value">:default</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-constant">Source</span><span class="ruby-operator">::</span><span class="ruby-constant">RubygemsAggregate</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">sources</span>, <span class="ruby-identifier">source_map</span>) }.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">source_map</span>.<span class="ruby-identifier">direct_requirements</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">source_requirements</span>.<span class="ruby-identifier">merge!</span>(<span class="ruby-identifier">source_map</span>.<span class="ruby-identifier">locked_requirements</span>) <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@remote</span>
  <span class="ruby-identifier">metadata_dependencies</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">dep</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">source_requirements</span>[<span class="ruby-identifier">dep</span>.<span class="ruby-identifier">name</span>] = <span class="ruby-identifier">sources</span>.<span class="ruby-identifier">metadata_source</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">default_bundler_source</span> = <span class="ruby-identifier">source_requirements</span>[<span class="ruby-string">&quot;bundler&quot;</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">default_source</span>

  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@unlocking_bundler</span>
    <span class="ruby-identifier">default_bundler_source</span>.<span class="ruby-identifier">add_dependency_names</span>(<span class="ruby-string">&quot;bundler&quot;</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">source_requirements</span>[<span class="ruby-value">:default_bundler</span>] = <span class="ruby-identifier">default_bundler_source</span>
    <span class="ruby-identifier">source_requirements</span>[<span class="ruby-string">&quot;bundler&quot;</span>] = <span class="ruby-identifier">sources</span>.<span class="ruby-identifier">metadata_source</span> <span class="ruby-comment"># needs to come last to override</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">verify_changed_sources!</span>
  <span class="ruby-identifier">source_requirements</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-specs_changed-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">specs_changed?</span><span
                                class="method-args">(source)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Check if the specs of the given source changed according to the locked source.</p>

                              <div class="method-source-code" id="specs_changed-3F-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 642</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">specs_changed?</span>(<span class="ruby-identifier">source</span>)
  <span class="ruby-identifier">locked</span> = <span class="ruby-ivar">@locked_sources</span>.<span class="ruby-identifier">find</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">source</span> }

  <span class="ruby-operator">!</span><span class="ruby-identifier">locked</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">dependencies_for_source_changed?</span>(<span class="ruby-identifier">source</span>, <span class="ruby-identifier">locked</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">specs_for_source_changed?</span>(<span class="ruby-identifier">source</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-specs_for_source_changed-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">specs_for_source_changed?</span><span
                                class="method-args">(source)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="specs_for_source_changed-3F-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 655</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">specs_for_source_changed?</span>(<span class="ruby-identifier">source</span>)
  <span class="ruby-identifier">locked_index</span> = <span class="ruby-constant">Index</span>.<span class="ruby-identifier">new</span>
  <span class="ruby-identifier">locked_index</span>.<span class="ruby-identifier">use</span>(<span class="ruby-ivar">@locked_specs</span>.<span class="ruby-identifier">select</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">source</span>.<span class="ruby-identifier">can_lock?</span>(<span class="ruby-identifier">s</span>) })

  <span class="ruby-comment"># order here matters, since Index#== is checking source.specs.include?(locked_index)</span>
  <span class="ruby-identifier">locked_index</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">source</span>.<span class="ruby-identifier">specs</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">PathError</span>, <span class="ruby-constant">GitError</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">e</span>
  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">debug</span> <span class="ruby-node">&quot;Assuming that #{source} has not changed since fetching its specs errored (#{e})&quot;</span>
  <span class="ruby-keyword">false</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-start_resolution" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">start_resolution</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="start_resolution-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 569</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">start_resolution</span>
  <span class="ruby-identifier">result</span> = <span class="ruby-identifier">resolver</span>.<span class="ruby-identifier">start</span>

  <span class="ruby-ivar">@resolved_bundler_version</span> = <span class="ruby-identifier">result</span>.<span class="ruby-identifier">find</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">spec</span><span class="ruby-operator">|</span> <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">name</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;bundler&quot;</span> }&amp;.<span class="ruby-identifier">version</span>

  <span class="ruby-constant">SpecSet</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">SpecSet</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">result</span>).<span class="ruby-identifier">for</span>(<span class="ruby-identifier">dependencies</span>, <span class="ruby-keyword">false</span>, <span class="ruby-ivar">@platforms</span>))
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-verify_changed_sources-21" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">verify_changed_sources!</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="verify_changed_sources-21-source">
            <pre><span class="ruby-comment"># File bundler/definition.rb, line 907</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">verify_changed_sources!</span>
  <span class="ruby-ivar">@specs_that_changed_sources</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">source</span>.<span class="ruby-identifier">specs</span>.<span class="ruby-identifier">search</span>(<span class="ruby-identifier">s</span>.<span class="ruby-identifier">name</span>).<span class="ruby-identifier">empty?</span>
      <span class="ruby-identifier">raise</span> <span class="ruby-constant">GemNotFound</span>, <span class="ruby-node">&quot;Could not find gem &#39;#{s.name}&#39; in #{s.source}&quot;</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is provided by <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>.</p><p><a href="https://jamesbritt.bandcamp.com/">Maximum R+D</a>.  </p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

